﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Threading;
using System.Globalization;
using System.Resources;

using EHTWebsite.Code;

public partial class Controls_ThongKeTruyCapControl : System.Web.UI.UserControl
{
    public Boolean IsVN = true;
    String languageCode = "vi-VN";
    private ResourceManager rm = new ResourceManager("Resources.SiteMap", System.Reflection.Assembly.Load("App_GlobalResources"));

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ThongTinCongTy theThongTinCongTy = ThongTinCongTyProvider.GetThongTinCongTy();
            this.ltrLuotTruyCap.Text = theThongTinCongTy.LuotTruyCap.ToString();
            this.ltrOnline.Text = Application["AmountOfOnLine"].ToString();

            try
            {
                languageCode = Session[HangSo.LANGUAGE_CODE].ToString();

                if (languageCode == "en-us")
                {
                    IsVN = false;
                }

            }
            catch (Exception ex)
            {
            }

            Thread.CurrentThread.CurrentCulture = new CultureInfo(languageCode);
            LoadLanguage(Thread.CurrentThread.CurrentCulture);
        }
    }

    public void LoadLanguage(CultureInfo ci)
    {
        this.ltrThongKe.Text = rm.GetString("ltrThongKe_Title", ci);
        this.ltrLuotTruyCap_Title.Text = rm.GetString("ltrLuotTruyCap_Title", ci);
        this.lrtOnline_Title.Text = rm.GetString("ltrOnline_Title", ci);
    }
}
